import Vue from "vue";
import VueRouter from "vue-router";
import Main from "@/pages/Main";
import MainHome from "@/pages/MainHome";
import HomeFollow from "@/pages/HomeFollow";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Main",
    component: Main,
    redirect: "/main/home"
  },
  {
    path: "/main",
    name: "Main",
    component: Main,
    children: [
      {
        path: "home",
        component: MainHome,
        children: [
          {
            path: "follow",
            component: HomeFollow
          }
        ]
      }
    ]
  }
  // {
  //   path: "/about",
  //   name: "About",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () =>
  //     import(/* webpackChunkName: "about" */ "../views/About.vue")
  // }
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
